import React, { Component } from 'react'

// 导入 contextObj 对象
import contextObj from './context';
// 解构出 Consumer 组件
let { Consumer } = contextObj
export default class Son extends Component {
    render() {
        return (
            <div>
                <p>Son</p>
                <Consumer>
                    {
                        (value) => {
                            //console.log('this1', this)
                            return <p>儿子接收爷爷组件中的数据:{value}</p>
                        }
                    }
                </Consumer>

            </div>
        )
    };
}
